package com.tarrantcounty.entity;

public class Person implements Speakable
{
	private String name;
	
	public Person (String name)
	{
		setName(name);
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name) 
	{
		if (name != null && name.length() > 2 && name.length() < 50)
			this.name = name;
		else
			throw new IllegalArgumentException ("bad name");
	}

	@Override
	public String toString()
	{
		return "Hi, my name is " + name;
	}

	@Override
	public void speak()
	{
		System.out.println("Do you have any grey poupon?");
		
	}

	@Override
	public void speak(int repeats)
	{
		for (int i=0;i<repeats;i++)
			this.speak();
		
	}
	
	

}
